<?php

/**
 * EmpresaEgresosDetalles form base class.
 *
 * @method EmpresaEgresosDetalles getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEmpresaEgresosDetallesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'empresa_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'empresa_egresos_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmpresaEgresos'), 'add_empty' => false)),
      'concepto_cf_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => false)),
      'division_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'add_empty' => true)),
      'nomina_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Nomina'), 'add_empty' => true)),
      'camioneta_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'producto_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Producto'), 'add_empty' => true)),
      'categoria_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'add_empty' => false)),
      'entidad_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => false)),
      'is_impuesto'        => new sfWidgetFormInputText(),
      'cantidad'           => new sfWidgetFormInputText(),
      'presentacion'       => new sfWidgetFormInputText(),
      'precio_unitario'    => new sfWidgetFormInputText(),
      'sub_total'          => new sfWidgetFormInputText(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'empresa_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'empresa_egresos_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('EmpresaEgresos'))),
      'concepto_cf_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'required' => false)),
      'division_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'required' => false)),
      'nomina_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Nomina'), 'required' => false)),
      'camioneta_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'required' => false)),
      'producto_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Producto'), 'required' => false)),
      'categoria_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'required' => false)),
      'entidad_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'required' => false)),
      'is_impuesto'        => new sfValidatorInteger(array('required' => false)),
      'cantidad'           => new sfValidatorInteger(array('required' => false)),
      'presentacion'       => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'precio_unitario'    => new sfValidatorNumber(array('required' => false)),
      'sub_total'          => new sfValidatorNumber(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(),
      'updated_at'         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('empresa_egresos_detalles[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmpresaEgresosDetalles';
  }

}
